package com.itheima.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {
    //读取yaml数据中的多级目录下的属性值
    @Value("${user.name}")
    private String name;

    //读取yaml数据中的单一数据
    @Value("${country}")
    private String country;

    //读取yaml数据中的单一数据
    @Value("${bobby[1]}")
    private String likes1;

    @Value("${tempDir}")
    private String path;


    @GetMapping
    public String getById(){
        System.out.println("springboot is runing");
        System.out.println("user:name=====>"+name);
        System.out.println("country====>"+country);
        System.out.println("likes====>"+likes1);

        System.out.println("临时路径：===》"+path);
        return "springboot is runing";
    }
}
